package com.diligent.cloud.sfc.resources.impl;

import com.canny.commons.model.ObjectResult;
import com.diligent.cloud.sfc.model.params.inventory.AddRubberStripInventoryParams;
import com.diligent.cloud.sfc.resources.WorkShopPostProcessResource;
import com.diligent.cloud.sfc.service.WorkShopPostProcessService;
import com.diligent.cloud.web.resource.impl.AbstractActionResourceImpl;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController;

/**
 * WorkShopPostProcessResourceImpl class
 *
 * @author xf107278
 * @date 4/20/2020
 */

@RestController
public class WorkShopPostProcessResourceImpl extends AbstractActionResourceImpl implements WorkShopPostProcessResource {

    private WorkShopPostProcessService workShopPostProcessService;

    public WorkShopPostProcessResourceImpl(WorkShopPostProcessService workShopPostProcessService) {
        this.workShopPostProcessService = workShopPostProcessService;
        init();
    }

    @Override
    public ResponseEntity<ObjectResult> selectById(Long id) {
        return null;
    }

    private void init(){
        super.registerAction(HttpMethod.POST.toString(), "addRubberStripInventory", AddRubberStripInventoryParams.class, (var1, var2, var3) -> {

            return workShopPostProcessService.addRubberStripInventory(var3.getRubberStripInventoryParams(),var3.getPrincipal());
        });
    }



}
